export const Base = (base: string) => {
  const fn: ClassDecorator = (target) => {
    Reflect.defineMetadata("base", base, target.prototype);
  };
  return fn;
};

export function Get(url: string) {
  const fn: MethodDecorator = (target, key, descriptor: PropertyDescriptor) => {
    Reflect.defineMetadata("url", url, target, key);
    Reflect.defineMetadata("method", "get", target, key);
  };
  return fn;
}

export function Post(url: string) {
  const fn: MethodDecorator = (target, key, descriptor: PropertyDescriptor) => {
    Reflect.defineMetadata("url", url, target, key);
    Reflect.defineMetadata("method", "post", target, key);
  };
  return fn;
}

export function Delete(url: string) {
  const fn: MethodDecorator = (target, key, descriptor: PropertyDescriptor) => {
    Reflect.defineMetadata("url", url, target, key);
    Reflect.defineMetadata("method", "delete", target, key);
  };
  return fn;
}
export function Put(url: string) {
  const fn: MethodDecorator = (target, key, descriptor: PropertyDescriptor) => {
    Reflect.defineMetadata("url", url, target, key);
    Reflect.defineMetadata("method", "put", target, key);
  };
  return fn;
}
